import { requestsearch } from '@/api'

const actions = {
    search(context, value) {
        requestsearch(value).then(function(res) {

            context.commit('REQUESTSEARCH', res.data.data)
        })
    }
}
const mutations = {
    REQUESTSEARCH(state, value) {
        state.search = value
    }
}
const state = {
    search: {}
}
const getters = {
    goodslist(state) {
        return state.search.goodsList
    },
    attrsList(state) {
        return state.search.attrsList
    },
    trademarkList(state) {
        return state.search.trademarkList
    }
}

export default {
    actions,
    mutations,
    state,
    getters,

}